<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        [v-cloak] {
            display: none;
        }

        * {
            margin: 0;
            padding: 0;
            list-style: none
        }

        .container {
            width: 300px;
            height: 200px;
            margin: 100px auto
        }

        .title {
            display: flex;
            height:30px
        }

        .title li {
            font-size: 20px;
            flex: 1;
           
            text-align: center;
        }

        .title li.active {
            background: orangered;
            color: #FFF;
        }

        .content li {
            word-break: break-all;
            line-height: 200px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="container" v-cloak>
            <ul class="title">
                <li @click="activeIndex=0" :class="{active:activeIndex===0}">汽车票</li>
                <li @click="activeIndex=1" :class="{active:activeIndex===1}">火车票</li>
                <li @click="activeIndex=2" :class="{active:activeIndex===2}">飞机票</li>
            </ul>
            <ul class="content">
                <li v-show="activeIndex===0">aaaaaaaaaaa</li>
                <li v-show="activeIndex===1">bbbbbbbbbbbbbbbbbbbbbb</li>
                <li v-show="activeIndex===2">ccccccccccccccccccccccccccccccccccccccccc</li>
            </ul>

        </div>


    </div>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    activeIndex: 0
                }
            },
        })

    </script>
</body>

</html>